/*
Copyright 2007 Nathan Baker

This file is part of XAliens.

XAliens is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

XAliens is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with XAliens.  If not, see <http://www.gnu.org/licenses/>.
 */

package utils;

import java.awt.*;

public class ShotPositioner {
    Point mOriginalPos;
    int mVelocity = 1;

    public ShotPositioner(Point p) {
        mOriginalPos = p;
    }

    public ShotPositioner(Point p, int velocity) {
        mOriginalPos = p;
        mVelocity = velocity;
    }

    public enum PathType {
        Straight, SineWave, MissleStraight, MissleCurve;
    }

    public Point getNewPosition(PathType path, Point oldPos) {
        Point newPos = new Point();

        switch (path) {
            case Straight:
                newPos = new Point((int) oldPos.getX() - mVelocity, (int) oldPos.getY());
                break;
            default:
                break;
        }

        return newPos;
    }

    public void setOriginalPosition(Point p) {
        mOriginalPos = p;
    }

    public void setVelocity(int v) {
        mVelocity = v;
    }
}
